import { Tag } from "antd";
import { BuildGraphStatus } from "types/graph-builder";

export const renderStatusTag = (status: BuildGraphStatus) => {
  const statusConfig = {
    pending: { color: 'orange', text: '等待中' },
    building: { color: 'blue', text: '构建中' },
    completed: { color: 'green', text: '已完成' },
    failed: { color: 'red', text: '失败' },
    deleted: { color: 'gray', text: '已删除' }
  };

  const config = statusConfig[status] || statusConfig.deleted;
  return <Tag color={config.color}>{config.text}</Tag>;
};